package com.apes.hr.base.repository;

import com.apes.framework.jpa.repository.CustomRepository;
import com.apes.hr.base.model.PersonGroup;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * @author Fengjiajing
 * @create 2018-08-25 16:07
 */
public interface PersonGroupRepository extends CustomRepository<PersonGroup, String>{

    @Query("select T from PersonGroup T where 1 = 1 and valid = 1 and (id like %:value%  or name like %:value%) ")
    Page<PersonGroup> find(@Param("value") String value, Pageable pageable);
}
